package fr.afcepf.atod18.fw.controler;

import java.util.Map;

import fr.afcepf.atod18.fw.form.IActionForm;

public class FactoryActionForm {


    public FactoryActionForm() { }
    
    public IActionForm done(String provenance, Map<String, Class<IActionForm>> params){
        
        Class<IActionForm> c = params.get(provenance);
        IActionForm a = null;
        
        try{
            a = (IActionForm)c.newInstance();
        }
        catch (InstantiationException ie){
            ie.printStackTrace();
        }
        catch (IllegalAccessException e){
            e.printStackTrace();
        }
        return a; 
    }
}
